const Koa=require("koa")
const bodyparser=require("koa-bodyparser")
const route=require("koa-router")
const path=require("path")
const koaStatic=require("koa-static")


const app=new Koa()
const router=route();
const staticPath="./"

app.use(koaStatic(path.join(__dirname,staticPath)))

router.get("/result",async (ctx,next)=>{
    //获取提交的数据
    let queryObj=ctx.request.query;
    let value=queryObj.callback;
    console.log(value)
    ctx.response.body=value+"('hello')"
})
app.use(bodyparser())
app.use(router.routes())
app.listen(3000,function () {
    console.log(path.join(__dirname,staticPath))
})